<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>商城会员中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <link rel="stylesheet" type="text/css" href="/shop/css/center.css"/>
    <link rel="stylesheet" type="text/css" href="/shop/css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="/shop/css/loading.css"/>
    <script src="/shop/js/rem.js"></script>
    <script src="/shop/js/jquery.min.js" type="text/javascript"></script>
    <script src="/js/plugins/jrender/jrender.js"></script>
    <script type="text/javascript">
        sessionStorage.url = "confirm";
        $(window).load(function () {

            // 获取用户的基本信息
            var user = JSON.parse(sessionStorage.getItem("user"));
            // 渲染用户信息
            $(".vip-header").renderValues(user, {
                name: function (ele, value) {
                    ele.innerHTML = value + "<span>普通会员</span>";
                }
            });
            // 渲染背景
            $(".vip-header").css("background-image", "url('" + user.coverImgUrl + "')");

            // 获取用户的积分
            // 页面加载完毕发送请求查询用户对应的商场积分
            $.get("/signs/" + user.id + "/credits", function (data) {
                if (data.success) {
                    // 当前用户有积分
                    $(".points").html("<span>我的积分：<i>" + data.data.signPoints + "</i></span>");
                    $("#myPoints").html("<a href=\"default.htm\"><i class=\"color_f4a425\">" + data.data.signPoints + "</i>\n" + "<p>我的积分</p></a>");
                } else {
                    // 当前用户没有积分
                    $("#points").html("<span>积分：<i>" + 0 + "</i></span>");
                    $("#myPoints").html("<a href=\"default.htm\"><i class=\"color_f4a425\">" + 0 + "</i>\n" + "<p>我的积分</p></a>");
                }
            });

            // 发送请求查询用户待兑换的订单信息
            $.get("/orders/" + user.id + "/orders", {status: 1}, function (data) {
                var orders = data.length;
                $("#waitPay").html(orders);
            });

            // 发送请求查询用户待兑换的订单信息
            $.get("/orders/" + user.id + "/orders", {status: 2}, function (data) {
                console.log(data);
                var orders = data.length;
                $("#waitReceive").html(orders);
            });


            $(".loading").addClass("loader-chanage");
            $(".loading").fadeOut(300);
        })
    </script>
</head>
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<body style="background-color: #f0f0f0">
<header id="header" style="">
    <div class="topbar">
        <a href="javascript:history.back();" class="back_btn">
            <!--<i class="iconfont">ş</i>-->
            <i class="iconfont icon-fanhui"></i>
        </a>
        <h1 class="page_title">会员中心</h1>
    </div>
</header>


<!-- 会员头像 -->
<div class="vip-header">
    <a href="default.htm">
        <dl>
            <dt>
                <img src="" render-src="headImgUrl"/>
            </dt>
            <dd>
                <h4 render-key="nickName" render-fun="name"></h4>
                <p class="points"><span>积分：<i></i></span></p>
            </dd>
        </dl>
        <ul>
            <li><a href="default.htm"><span id="waitPay"></span>
                <p>待付款</p></a></li>
            <li><a href="default.htm"><span id="waitReceive">0</span>
                <p>待收货</p></a></li>
            <li><a href="default.htm"><span>0</span>
                <p>待评价</p></a></li>
        </ul>
    </a>
</div>
<!-- 会员俱乐部 -->
<div class="vip-club border_top_bottom">
    <div class="vip-club-title border_bottom">
        <span><i class="iconfont"></i>会员俱乐部</span>
        <a href="/mine/sign.html">每日签到领积分<i class="iconfont"></i></a>
    </div>
    <ul>
        <li><a href="/mine/shoporder.html"><i class="iconfont"></i>
            <p>我的订单</p></a></li>
        <li><a href="default.htm"><i class="iconfont"></i>
            <p>我的秒杀</p></a></li>
        <li><a href="default.htm"><i class="iconfont" style="font-size: 28px;"></i>
            <p>我的众筹</p></a></li>
        <li><a href="default.htm"><i class="iconfont"></i>
            <p>我的预约</p></a></li>
    </ul>
</div>
<div class="vip-club border_top_bottom vip-account">
    <div class="vip-club-title border_bottom">
        <span><i class="iconfont"></i>我的账户</span>
        <a href="index.html">积分兑换商品<i class="iconfont"></i></a>
    </div>
    <ul>
        <li><a href="default.htm"><i class="color_f44623">0</i>
            <p>账户余额</p></a></li>
        <li id="myPoints"></li>
        <li><a href="default.htm"><i class="color_45a1de">0</i>
            <p>我的礼券</p></a></li>
        <li><a href="default.htm"><i class="color_1dccaa">1</i>
            <p>宝贝收藏</p></a></li>
    </ul>
</div>
<div class="vip-list-icon border_top_bottom">
    <ul>
        <li class="border_bottom">
            <a href="default.htm" class="border_right"><i class="iconfont icon-sousuo"></i><em>维修查询</em></a>
            <a href="default.htm"><i class="iconfont" style="font-size:24px;"></i><em>报修退换</em></a>
        </li>
        <li class="border_bottom">
            <a href="default.htm" class="border_right"><i class="iconfont"
                                                          style="font-size:24px;"></i><em>物流查询</em></a>
            <a href="address.html" onclick="sessionStorage.url = 'center';"><i
                    class="iconfont icon-dizhi1"></i><em>收货地址</em></a>
        </li>
        <li class="border_bottom">
            <a href="default.htm" class="border_right"><i class="iconfont"></i><em>评价晒单</em></a>
            <a href="default.htm"><i class="iconfont" style="font-size:20px; text-indent:2px;"></i><em>我的投诉</em></a>
        </li>
        <li>
            <a href="default.htm" class="border_right"><i class="iconfont"></i><em>我的咨询</em></a>
            <a href="default.htm"><i class="iconfont" style="font-size:23px;"></i><em>二手订单</em></a>
        </li>
    </ul>
</div>
<!--尾部-->
<footer class="page-footer fixed-footer" id="footer">
    <ul>
        <li>
            <a href="index.html">
                <i class="iconfont icon-shouye"></i>
                <p>首页</p>
            </a>
        </li>
        <li>
            <a href="cation.html">
                <i class="iconfont icon-icon04"></i>
                <p>分类</p>
            </a>
        </li>
        <li>
            <a href="shopcar.html">
                <i class="iconfont icon-gouwuche"></i>
                <p>购物车</p>
            </a>
        </li>
        <li class="active">
            <a href="center.html">
                <i class="iconfont icon-yonghuming"></i>
                <p>我的</p>
            </a>
        </li>
    </ul>
</footer>

</body>

</html>
